package cn.wm.struct;

import java.util.Arrays;

/**
 * Message
 *
 * @author wm
 * @version 1.0
 * 2021/6/24 16:32
 **/
public class Message {
    private int headerLength;
    private MessageHeader header;
    private int bodyLength;
    private byte[] body;

    public int getHeaderLength() {
        return headerLength;
    }

    public void setHeaderLength(int headerLength) {
        this.headerLength = headerLength;
    }

    public MessageHeader getHeader() {
        return header;
    }

    public void setHeader(MessageHeader header) {
        this.header = header;
    }

    public int getBodyLength() {
        return bodyLength;
    }

    public void setBodyLength(int bodyLength) {
        this.bodyLength = bodyLength;
    }

    public byte[] getBody() {
        return body;
    }

    public void setBody(byte[] body) {
        this.body = body;
    }

    @Override
    public String toString() {
        return "Message{" +
                "headerLength=" + headerLength +
                ", header=" + header +
                ", bodyLength=" + bodyLength +
                ", body=" + Arrays.toString(body) +
                '}';
    }
}
